Skip to content

feat(git): workspace turn checkpointing via git shadow refs for safe rollback - #635

Open
cagdasyurekli wants to merge 2 commits into
andrewyng:mainfrom
cagdasyurekli:feat/issue-614-workspace-checkpoints
Open

cagdasyurekli wants to merge 2 commits into
andrewyng:mainfrom
cagdasyurekli:feat/issue-614-workspace-checkpoints

Conversation

@cagdasyurekli

@cagdasyurekli cagdasyurekli commented Sep 6, 2026

Copy link
Copy Markdown

Closes #614

Changes

Capture the working tree before the first local write in a turn and expose revert_turn for rollback. Store working-tree and staging snapshots in paired shadow refs, leaving HEAD and the real index unchanged during capture.

Restore uses NUL-delimited Git filenames, preserving Unicode, tabs and newlines, and restores the checkpoint's staged/unstaged split. It removes only extra nonignored files identified by Git and prunes empty directories. Snapshot creation publishes both refs in one transaction and refuses to overwrite an existing turn; resumed engines continue checkpoint numbering.

Checkpoint operations require the workspace to be the Git repository root. Subdirectory workspaces and legacy checkpoints without a staging snapshot fail closed rather than restoring a partial repository or guessing the index state.

Verification

  • Full Python suite: pytest tests -q — 1,966 passed, 1 skipped (macOS, Python 3.14).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Workspace turn checkpointing via lightweight git shadow refs for safe rollback

1 participant